// src/assets/styles/toolkit/environment.module.ts
import { css } from '@emotion/css';

export const header = css`
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  background: #096dd9;
  color: white;
  padding: 0 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  margin-bottom: 24px;
`;

export const headerContainer = css`
  display: flex;
  align-items: center;
  height: 64px;
  font-size: 18px;
  font-weight: 600;
`;

export const headerContent = css`
  display: flex;
  align-items: center;
  font-size: 18px;
  font-weight: 600;

`;

export const dbEnvTab = css`
  // margin-right: 16px;
`;

export const dbVarTab = css`
  // margin-right: 16px;
`;

export const icon = css`
  margin-right: 12px;
  font-size: 24px;
`;


export const tableItem = (selected: boolean) => css`
  padding: 12px 16px;
  border-bottom: 1px solid #d9d9d9;
  cursor: pointer;
  background-color: ${selected ? '#e6f7ff' : 'white'};
  border-right: ${selected ? '3px solid #1890ff' : 'none'};
`;

export const tableItemDescription = css`
  font-size: 12px;
  color: #8c8c8c;
  margin-top: 4px;
`;

export const tableItemName = css`
  font-weight: 500;
`;


export const formItem = css`
  margin-bottom: 16px;
`;

export const formLabel = css`
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
`;

export const connectionStatus = css`
  display: flex;
  align-items: center;
  margin-top: 8px;
  font-weight: 500;
`;

export const connected = css`
  color: #52c41a;
`;

export const disconnected = css`
  color: #ff4d4f;
`;

export const editableTitle = css`
  display: flex;
  align-items: center;
`;

export const editableText = css`
  &:hover {
    text-decoration: underline;
  }
`;

export const editIcon = css`
  margin-left: 8px;
  font-size: 12px;
  color: #1890ff;
`;

// 环境变量管理组件样式
export const container = css`
  // max-width: 1200px;
  margin: 0 auto;
  // padding: 20px;
  background-color: #f5f7fa;
  color: #333;
  font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", Arial, sans-serif;
  line-height: 1.5;
`;

export const varHeader = css`
  display: flex;
  justify-content: space-between;
  align-items: center;
  // margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e4e7ed;
`;

export const varHeaderTitle = css`
  // font-size: 24px;
  // font-weight: 500;
  // color: #303133;
`;

export const card = css`
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
  overflow: hidden;
`;

export const cardHeader = css`
  padding: 15px 20px;
  border-bottom: 1px solid #e4e7ed;
  display: flex;
  justify-content: space-between;
  align-items: center;
`;

export const cardHeaderTitle = css`
  font-size: 16px;
  font-weight: 500;
`;

export const cardBody = css`
  padding: 20px;
`;

export const btn = css`
  display: inline-block;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  background: #fff;
  border: 1px solid #dcdfe6;
  color: #606266;
  text-align: center;
  box-sizing: border-box;
  outline: none;
  margin: 0;
  transition: .1s;
  font-weight: 500;
  padding: 8px 15px;
  font-size: 14px;
  border-radius: 4px;
`;

export const btnPrimary = css`
  color: #fff;
  background-color: #409EFF;
  border-color: #409EFF;
`;

export const btnSuccess = css`
  color: #fff;
  background-color: #67C23A;
  border-color: #67C23A;
`;

export const btnDanger = css`
  color: #fff;
  background-color: #F56C6C;
  border-color: #F56C6C;
`;

export const btnSmall = css`
  padding: 6px 10px;
  font-size: 12px;
`;

export const formGroup = css`
  margin-bottom: 15px;
`;

export const formControl = css`
  display: block;
  width: 100%;
  padding: 8px 15px;
  font-size: 14px;
  line-height: 1.5;
  color: #606266;
  background-color: #fff;
  background-image: none;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  transition: border-color .2s cubic-bezier(.645,.045,.355,1);
  
  &:focus {
    outline: none;
    border-color: #409EFF;
  }
`;

export const table = css`
  width: 100%;
  border-collapse: collapse;
`;

export const tableTh = css`
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #e4e7ed;
  background-color: #fafafa;
  font-weight: 500;
  color: #606266;
`;

export const tableTd = css`
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #e4e7ed;
`;

export const actions = css`
  display: flex;
  gap: 5px;
`;

export const envTabs = css`
  display: flex;
  border-bottom: 1px solid #e4e7ed;
  margin-bottom: 20px;
`;

export const envTab = css`
  padding: 10px 20px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.3s;
`;

export const envTabActive = css`
  color: #409EFF;
  border-bottom-color: #409EFF;
`;

export const envContent = css`
  display: none;
`;

export const envContentActive = css`
  display: block;
`;

export const emptyState = css`
  text-align: center;
  padding: 40px 0;
  color: #909399;
  
  p {
    margin-top: 10px;
  }
`;

export const badge = css`
  display: inline-block;
  padding: 3px 6px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 10px;
  color: #fff;
`;

export const badgePrimary = css`
  background-color: #409EFF;
`;

export const badgeSuccess = css`
  background-color: #67C23A;
`;

export const badgeWarning = css`
  background-color: #E6A23C;
`;